package com.tl.juc.c2;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class C3_ExecuteVSSubmit {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService threadPool = Executors.newFixedThreadPool(5);

        final Future<Integer> future = threadPool.submit(() -> {
            System.out.println("执行");
            return 5;
        });
        final Integer integer = future.get();
        System.out.println(integer);
    }
}
